harden gbfgetcstr, gbfgetpstr. (#782)
authortsteven4 <13596209+tsteven4@users.noreply.github.com>
Sun, 5 Dec 2021 22:30:05 +0000 (15:30 -0700)
committerGitHub <noreply@github.com>
Sun, 5 Dec 2021 22:30:05 +0000 (15:30 -0700)
commit1ed58953b7a50c9a5e994e3d8d35055bef007fcd
treec92cd66466cd7bb1b36bad347de6e6ef936d5997
parent85502cb3fd168287a24c5b14fa038cc0f02922eb
harden gbfgetcstr, gbfgetpstr. (#782)

Hangs were detected with afl and the gdb reader and gbfgetcstr.  One such
hang reads a fuzzed 32 bit url count with FREAD_i32, and then proceeds
to fetch that many strings with FREAD_CSTR_AS_QSTR.  This results in
fetches from beyond EOF that are undetected.  gbfgetcstr_old is modified
to throw a fatal error if reading is attempted beyond EOF.

A similar failure was not detected with gbfgetpstr, but it is also
modified to throw a fatal error if reading is attempted beyond EOF.
gbfile.cc